﻿using MediatR;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebMediaTRApi.WeatherForcasts.Querys;

namespace WebMediaTRApi.WeatherForcasts.Handlers
{

    public class LogHandler : INotificationHandler<NewUser>
    {
        private readonly ILogger<LogHandler> _logger;

        public LogHandler(ILogger<LogHandler> logger)
        {
            _logger = logger;
        }
        public Task Handle(NewUser notification, CancellationToken cancellationToken)
        {
            //Save to log  
            Thread.Sleep(200);
            _logger.LogInformation(" ****  User save to log  *****");
            return Task.FromResult(true);
        }
    }
}
